package 笔试记录.M8day8小米.小米;

public class 测试开发卷2 {
    public static void main(String[] args){
        String s = "I love Xiaomi";
        System.out.println(solve(s));
    }

    public static String solve(String str){
        char[] arr = str.toCharArray();
        StringBuilder s= new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == ' '){
                s.append("%20");
            }else{
                s.append(arr[i]);
            }
        }
        return s.toString();
    }
}
